<template>
  <div>
    <LsdTable slot="gjxm" :paginationAtrrs="paginationAtrrs" :compRef="table.compRef" ref="gjxm" :columns="table.columns" :title="table.title" :actions="table.actions" :tableData="table.tableData" :tableAttr="table.tableAttr" :isShowPage="false" :isSelectFlag="false" :isSequenceFlag="table.isSequenceFlag" />
  </div>
</template>
<script>
import { getJudgeInfoListApi } from "@/api/EmergencyDisposal/xyyp.js";
export default {
  data() {
    return {
      paginationAtrrs: {
        total: 0,
        "background": true,
        layout: "prev, pager, next",
        "current-page": 1,
        "page-size": 10
      },
      table: {
        isSelectFlag: false,
        compRef: "gjxm",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        title: "灾情信息统计表",
        actions: [
        ],
        tableData: [],
        columns: [
          {
            prop: "unitName",
            label: "所属单位",
            align: "center",
            "min-width": "100px"
          },
          {
            prop: "",
            label: "输电线路",
            align: "center",
            "min-width": "100px",
            children: [
              {
                prop: "",
                label: "500kV及以上",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sdxl500KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl500KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "sdxl500KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl500KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              },
              {
                label: "220kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sdxl220KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl220KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "sdxl220KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl220KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              },
              {
                label: "110kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sdxl110KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl110KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "sdxl110KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl110KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              },
              {
                label: "35kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "sdxl35KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl35KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "sdxl35KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.sdxl35KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              }
            ]
          },
          {
            label: "变电站",
            align: "center",
            "min-width": "100px",
            children: [
              {
                label: "500kV及以上",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "bdz500KvTrip",
                    label: "累计停运",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.bdz500KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "bdz500KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.bdz500KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              },
              {
                label: "220kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "bdz220KvTrip",
                    label: "累计停运",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                            >
                              {row.bdz220KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "bdz220KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.bdz220KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              },
              {
                label: "110kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "bdz110KvTrip",
                    label: "累计停运",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.bdz110KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "bdz110KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.bdz110KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              },
              {
                label: "35kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "bdz35KvTrip",
                    label: "累计停运",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.bdz35KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "bdz35KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.bdz35KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              }
            ]
          },
          //
          {
            label: "配电线路",
            align: "center",
            "min-width": "100px",
            children: [
              {
                label: "10kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "pdxl10KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.pdxl10KvTrip}
                            </span>
                          }
                        </div>
                      );
                    }
                  },
                  {
                    prop: "pdxl10KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px",
                    render: (h, { row }) => {
                      return (
                        <div>
                          {
                            <span
                              style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                            >
                              {row.pdxl10KvRecover}
                            </span>
                          }
                        </div>
                      );
                    }
                  }
                ]
              }
            ]
          },
          {
            label: "台区",
            align: "center",
            "min-width": "120px",
            children: [
              {
                prop: "tqTrip",
                label: "累计停电",
                align: "center",
                "min-width": "120px",
                render: (h, { row }) => {
                  return (
                    <div>
                      {
                        <span
                          style='color:#3561fd;cursor:pointer;text-decoration: underline;'

                        >
                          {row.tqTrip}
                        </span>
                      }
                    </div>
                  );
                }
              },
              {
                prop: "tqRecover",
                label: "累计恢复",
                align: "center",
                "min-width": "120px",
                render: (h, { row }) => {
                  return (
                    <div>
                      {
                        <span
                          style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                        >
                          {row.tqRecover}
                        </span>
                      }
                    </div>
                  );
                }
              },
              {
                prop: "tqRater",
                label: "恢复率",
                align: "center",
                "min-width": "120px"
              }
            ]
          },
          {
            label: "用户",
            align: "center",
            "min-width": "120px",
            children: [
              {
                prop: "ptyhTrip",
                label: "累计停电",
                align: "center",
                "min-width": "120px",
                render: (h, { row }) => {
                  return (
                    <div>
                      {
                        <span
                          style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                        >
                          {row.ptyhTrip}
                        </span>
                      }
                    </div>
                  );
                }
              },
              {
                prop: "ptyhRecover",
                label: "累计恢复",
                align: "center",
                "min-width": "120px",
                render: (h, { row }) => {
                  return (
                    <div>
                      {
                        <span
                          style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                        >
                          {row.ptyhRecover}
                        </span>
                      }
                    </div>
                  );
                }
              },
              {
                prop: "ptyhRater",
                label: "恢复率",
                align: "center",
                "min-width": "120px"
              }
            ]
          },
          {
            label: "重要用户",
            align: "center",
            "min-width": "120px",
            children: [
              {
                prop: "zyyhTrip",
                label: "累计停电",
                align: "center",
                "min-width": "120px",
                render: (h, { row }) => {
                  return (
                    <div>
                      {
                        <span
                          style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                        >
                          {row.zyyhTrip}
                        </span>
                      }
                    </div>
                  );
                }
              },
              {
                prop: "zyyhRecover",
                label: "累计恢复",
                align: "center",
                "min-width": "120px",
                render: (h, { row }) => {
                  return (
                    <div>
                      {
                        <span
                          style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                        >
                          {row.zyyhRecover}
                        </span>
                      }
                    </div>
                  );
                }
              },
              {
                prop: "zyyhRater",
                label: "累计率",
                align: "center",
                "min-width": "120px"
              }
            ]
          }
        ],
        tableAttr: {
          "max-height": "470px",
          height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      }
    };
  },
  props: {
    id: {
      type: String,
      default: ""
    }
  },
  mounted() {
    this.list();
  },
  methods: {
    async list() {
      const res = await getJudgeInfoListApi({ emergencyId: this.id });
      this.table.tableData = res;
      this.paginationAtrrs.total = res.length;
    }
  }
};
</script>
<style lang="less" scoped>

</style>
